import { useRequest } from 'vue-request'

export const testRequest = () => {
	const { data, loading, error } = useRequest(() => http.post('/mock/post'))
	return { data, loading, error }
}


/*
登录
 */

export const loginRequest = (request:any) => {
	const { data, loading, error }
		= useRequest(() => http.post('/api/login',request))
	return { data, loading, error }
}


/**
 * 注册
 * @param request
 */
export const registerRequest = (request:any) => {
	const { data, loading, error }
		= useRequest(() => http.post('/api/register',request))
	return { data, loading, error }
}
